package apt.bean;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "TBORDER")
public class OrderBean implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -4390739672042304568L;

	@Id
	@GeneratedValue
	@Column(name = "ORDERID")
	private int orderID;
	
	@Column(name = "TOTALPRICE")
	private float totalPrice;
	
	@Column(name = "DATE")
	private Date date;
	
	@Column(name = "STATUS")
	private boolean status;

	@OneToMany(mappedBy = "orderBean")
	private Set<OrderDetailBean> orderDetailBeans;
	
	@ManyToOne
	@JoinColumn(name = "UserID")
	private UserBean userBean;
	
	public OrderBean(float totalPrice, Date date, boolean status) {
		super();
		this.totalPrice = totalPrice;
		this.date = date;
		this.status = status;
	}

	public OrderBean() {
		// TODO Auto-generated constructor stub
	}
	
	public int getOrderID() {
		return orderID;
	}

	public void setOrderID(int orderID) {
		this.orderID = orderID;
	}

	public float getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(float totalPrice) {
		this.totalPrice = totalPrice;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public Set<OrderDetailBean> getOrderDetailBeans() {
		return orderDetailBeans;
	}

	public void setOrderDetailBeans(Set<OrderDetailBean> orderDetailBeans) {
		this.orderDetailBeans = orderDetailBeans;
	}

	public UserBean getUserBean() {
		return userBean;
	}

	public void setUserBean(UserBean userBean) {
		this.userBean = userBean;
	}
	
	
}
